package com.dby.comm;

import lombok.Data;

import java.util.List;

@Data
public class ResultMessage<T> {
    private String resultCode = "200";
    private String resultMessage = "success";

    private List<T> data;
    public static ResultMessage success(){
        return new ResultMessage();
    }
    public ResultMessage success(List<T> data){
        this.setData(data);
        return this;
    }
    public static ResultMessage fail(String resultMessageStr){
        ResultMessage resultMessage =  new ResultMessage();
        resultMessage.setResultCode("500");
        resultMessage.setResultMessage(resultMessageStr);
        return resultMessage;
    }
}